package pGeom2D;

import java.util.Vector;

import processing.core.PVector;

public class PPolygon2D {
public Vector<PVector>points;
	
	public PPolygon2D(float x, float y,float dX,float dY){
		points=PVecMath2D.getRectAsPoly(x,y, dX, dY);
		
	}
	public PPolygon2D(Vector<PVector> points,float offset) {
		if (offset!=0){
			this.points=PVecMath2D.getOffset(points, offset);
		}
		else{
			this.points = points;
		
		}
	}
	
	public PPolygon2D(float x1, float y1,float x2, float y2,float x3, float y3,float x4, float y4){
		points=new Vector<PVector>();
		points.add(new PVector(x1,y1));
		points.add(new PVector(x2,y2));
		points.add(new PVector(x3,y3));
		points.add(new PVector(x4,y4));
	}
	
	public PPolygon2D(Vector<PVector> points){
		points=points;
	}

	public Vector<PVector> getPoints() {
		return points;
	}

	public void setPoints(Vector<PVector> points) {
		this.points = points;
	}
}
